#ifndef QEDITCOMBOBOXITEMS_H
#define QEDITCOMBOBOXITEMS_H

#include <QDialog>

#include <QTreeWidget>
#include <QPushButton>

namespace Ui {
    class QEditComboBoxItems;
}

class QItemList : public QTreeWidget
{
    Q_OBJECT
public:
    QItemList(QWidget* parent=0);

    void    setValue(const QVariant &v);
    QVariant value();

public slots:
    void    addItem();
    void    removeSelect();

    void    editCurrent(const QModelIndex &index);
protected:
    QList<QTreeWidgetItem*> m_items;
};

class QEditComboBoxItems : public QDialog
{
    Q_OBJECT

public:
    explicit QEditComboBoxItems(QWidget *parent = 0);
    ~QEditComboBoxItems();

    void    setValue(const QVariant &v);
    QVariant value();

    int     exec();
protected slots:
    void    okClicked();
private:
    Ui::QEditComboBoxItems *ui;

protected:
    QItemList   *m_itemList;
    QPushButton *m_okBtn;
    QPushButton *m_addBtn;
    QPushButton *m_delBtn;
    int         m_ret;
};

#endif // QEDITCOMBOBOXITEMS_H
